<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    50年后的薪资为：
    <script>
        var year,money;
        year = 1;
        money  = 10;
        while(year<=50){
            money = money + money*0.05
            year++;     
        }
        document.write(money+'k');
    </script>
</body>
</html>